<script>
    function setConfig(configValue) {
        document.getElementById('config').value = configValue; 
        if(configValue == "delete") {
            document.getElementById('regcode').value = "delete";
            var confirmValue = confirm("정말 삭제하겠습니까?"); 
            if(confirmValue) {
                document.textbookfrm.submit();
            } else {
                alert('삭제 취소되었습니다.');
                return false;
            }
        }
        return true;
    }
</script>
<form enctype="multipart/form-data" method="POST" name="textbookfrm">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="hidden" name="regcode" id="regcode" value="{regcode}">
<input type="hidden" name="datano" value="{data.no}">
<input type="hidden" name="config" id="config" value="">
<input type="hidden" name="imagefile" value="{data.image}">
<table width="100%" cellspacing="0" cellpadding="0" border="0" background="images/sub_bg.gif">
<tbody><tr>
<td><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td background="images/sub_bg_title.gif"><img width="234" height="70" border="0" src="images/sub_title_business.gif"/></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td valign="top" height="40"><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td><img width="1" height="1" src="images/1blank.gif"/></td>
<td width="81" bgcolor="#000000" align="right"><a href="./teacher.php?add"><img width="69" height="24" border="0" src="images/sub_business_01.gif"/></a></td>
<td width="26" bgcolor="#000000"><img width="26" height="24" src="images/sub_menu_line.gif"/></td>
<td width="3" bgcolor="#000000"><a href="./bookManageDetail.php?add"><img width="51" height="24" border="0" src="images/sub_business_02.gif"/></a></td>
<td width="26" bgcolor="#000000"><img width="26" height="24" src="images/sub_menu_line.gif"/></td>
<td width="66" bgcolor="#000000"><a href="./courseManageDetail.php?add"><img width="54" height="24" border="0" src="images/sub_business_03.gif"/></a></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td width="30" valign="top"><img width="1" height="1" src="images/1blank.gif"/></td>
<td valign="top" height="40"><img width="168" height="19" src="images/sub_business_02_title.gif"/></td>
</tr>
<tr>
<td valign="top"><img width="1" height="1" src="images/1blank.gif"/></td>
<td valign="top"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td><table cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td width="543"><table width="543" rules="rows" frame="hsides" cellspacing="0" cellpadding="3" bordercolor="#cccccc" border="2" style="border-collapse: collapse;" class="font">
<tbody><tr>
<td><div align="left">교재명</div></td>
<td><div align="left">
<input type="text" maxlength="30" size="30" value="{data.name}" class="font" name="name"/>
</div></td>
</tr>
<tr>
<td width="130"><div align="left">저자</div></td>
<td><div align="left">
<input type="text" maxlength="20" size="20" value="{data.author}" class="font" name="author"/>
</div></td>
</tr>
<tr>
<td><div align="left">출판사</div></td>
<td><div align="left">
<input type="text" maxlength="20" size="20" value="{data.publisher}" class="font" name="publisher"/>
</div></td>
</tr>
<tr>
<td><div align="left">판매가격</div></td>
<td><div align="left">
<input type="text" maxlength="10" size="10" value="{data.price}" class="font" name="price"/>
원</div></td>
</tr>
<tr>
<td><div align="left">할인율</div></td>
<td><div align="left">
<input type="text" maxlength="10" size="10" value="10" id="{data.rate}" class="font" name="rate"/>
%</div></td>
</tr>
<tr>
<td><div align="left">할인율 적용</div></td>
<td><div align="left">미적용
<label>
<input type="radio" checked="checked" value="radio" id="radio" name="radio"/>
</label>
/ 적용
<!-- TODO!!! 할인율 DB추가 및 적용 -->
<input type="radio" value="radio" id="radio2" name="radio"/>
</div></td>
</tr>
<tr>
<td><div align="left">교재 이미지(320X240)</div></td>
<td><div align="left">
<label/>
<input type="file" class="font" name="img"/>
<!--{? data.image }-->
<br/>
현재 등록된 파일 : <a href="../data/bookImg/<?php echo urlencode({data.image}); ?>">{data.image}</a>
<input type="checkbox" name="filedelete">삭제</input>
<!--{/}-->
</div></td>
</tr>
<tr>
<td><div align="left">차례</div></td>
<td><div align="left">
<label/>
<label>
<textarea rows="10" cols="50" name="bookorder"/>
<?php echo stripslashes({data.bookorder}); ?>
</textarea>
</label>
<br/>
* 텍스트 및 HTML 코딩 가능 </div></td>
</tr>
<tr>
<td><div align="left">교재내용</div></td>
<td><div align="left">
<label>
<textarea rows="10" cols="50" name="contents"/>
<?php echo stripslashes({data.contents}); ?>
</textarea>
</label>
<br/>
* 텍스트 및 HTML 코딩 가능 </div></td>
</tr>
</tbody></table></td>
<td width="10" height="10"> </td>
<td width="230" valign="top"><table rules="rows" frame="hsides" cellspacing="0" cellpadding="3" bordercolor="#cccccc" border="2" style="border-collapse: collapse;" class="font">
<tbody><tr>
<td width="50"><div align="center">대분류</div></td>
<td width="200"><div align="left">
<select id="cate1" name="cate1"></select>
</div></td>
</tr>
<tr>
<td width="50"><div align="center">중분류</div></td>
<td><div align="left">
<select id="cate2" name="cate2"></select>
</div></td>
</tr>
<tr>
<td width="50"><div align="center">소분류</div></td>
<td><div align="left">
<select id="cate3" name="cate3"></select>
</div></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<button type=submit onClick="javascript:setConfig('add');" name="submit_add">{type} 완료 후 추가등록</button>&nbsp;
<button type=submit onClick="javascript:setConfig('list');" name="submit_list">{type} 완료</button>&nbsp;
<button type=reset>취소</button>&nbsp;
<!--{? type == "수정" }-->
<button type=button onClick="javascript:setConfig('delete');" name="submit_delete">상품 삭제</button>
<!--{/}-->
</tr>
</tbody></table></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table>
